package com.flick.student.resource;

import com.flick.po.Student;
import org.springframework.hateoas.mvc.ResourceAssemblerSupport;

public class StudentResourceAssembler extends ResourceAssemblerSupport<Student, StudentResource> {

    public StudentResourceAssembler() {
        super(StudentResourceAssembler.class, StudentResource.class);
    }

    @Override
    public StudentResource toResource(Student student) {
        StudentResource resource = createResourceWithId(student.getId(), student);
        return resource;
    }

    @Override
    protected StudentResource instantiateResource(Student entity) {
        return new StudentResource(entity);
    }
}
